package com.ys.ylideas;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@ComponentScan(basePackages={"com.ys.ylideas"})
@EnableAutoConfiguration
@EnableScheduling
@Configuration
public class YlIdeasApplication {

	public static void main(String[] args) {
		SpringApplication.run(YlIdeasApplication.class, args);
	}
	
    @Bean
    public EmbeddedServletContainerCustomizer containerCustomizer(){
          return new EmbeddedServletContainerCustomizer() {
              @Override
              public void customize(ConfigurableEmbeddedServletContainer container) {
                   container.setSessionTimeout(3600);//单位为S
             }
       };
    }
}
